package st.business.tepth.business.taskallocation.lag;

import java.util.List;

import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.LagInfoBean;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-06-10 14:31
 */

public class LagPresenter extends LagContract.Presenter {
    private final LagContract.View mView;
    private final LagContract.Model mModel;

    public LagPresenter(LagContract.View view) {
        mView = view;
        mModel = new LagModel();
    }

    @Override
    void getLagInfo(String token, int repairId) {
        addDisposable(mModel.getLagInfo(token, repairId,
                new OnDataConvertListener<List<LagInfoBean>>() {
                    @Override
                    public void convert(List<LagInfoBean> lagInfoBeans) {
                        mView.showData(lagInfoBeans);
                    }

                    @Override
                    public void error(int code, String msg) {
                        mView.showData(null);
                    }
                }));
    }
}
